import zrender from 'zrender/zrender'
import ZText from 'zrender/graphic/Text'

export default {
  mounted() {
    let zr = zrender.init(this.$refs.chart)
    let text = new ZText({
      // position : [50, 50],
      // rotation: 1,
      // scale: [2, 2],
      style: {
        x: 0,
        y: 0,
        text: '国国国国\n国国国国\n国国国国',
        width: 50,
        height: 50,
        fill: '#c0f',
        textFont: '18px Microsoft Yahei',
        textBaseline: 'top'
      },
      draggable: true
    })
    zr.add(text)
  },

  render(h) {
    return (
      <div class="page">
        <div ref="chart" style="width: 100%; height: 600px"></div>
      </div>
    )
  }
}
